<!--
 * @Description: 
 * @Author: Gaq
 * @Date: 2022-10-13 23:24:55
 * @LastEditTime: 2022-11-15 13:12:33
 * @LastEditors: Gaq
-->
<script setup>
import bus from "./utils";
import { useStore } from "vuex";
const { state, commit } = useStore();
let userId = computed(() => state.userId);
const ifShow = ref(true);

onBeforeMount(() => {
  if (localStorage.getItem("user")) {
    commit("SET_USERID", JSON.parse(localStorage.getItem("user")).userId);
  }
});
onMounted(() => {
  bus.on("ifShow", (value) => {
    ifShow.value = value;
  });
});
</script>

<template>
  <div>
    <Navigation v-if="ifShow" />
    <router-view></router-view>
  </div>
</template>